/*
 2    Class Name      : CasesListTestClass
 3    Created by      : Sreekanth SV Vegi
 4    Created On      : 05/02/2013
 5    Description     : This class helps to display all the related cases in queues related to advisor in one section and 
 6                      queues that are not related to advisor in another section   
 7    Version         : 1.0  
 8                   
 9    */
@isTest(SeeAllData=true)
public with sharing class CasesListTestClass
    {
     static testmethod void CasesListTestClass()
      {
        Account account=new Account(Name='Test Account');
        insert account;
        String westProspectiveStudentRecordTypeId = Schema.Sobjecttype.Lead.getRecordTypeInfosByName().get('West - Prospective Student').getRecordTypeId();
        
        Lead lead=new Lead(FirstName='Test First Name',LastName='Test Lead',RecordTypeId = westProspectiveStudentRecordTypeId ,Status='New',LeadSource='ALUM',Country='India',Email='abc@df.com',Phone='9957890878',Home_Phone__c='9090909090');
        insert lead;
        String westSupportRecordTypeId = Schema.Sobjecttype.Case.getRecordTypeInfosByName().get('West - Support').getRecordTypeId();
        Case admincase=new Case(Account=account,Lead__c=lead.id,RecordTypeId = westSupportRecordTypeId ,ownerId = userInfo.getUserID(),Group__c='Administration',Category__c='Admissions',Activity__c='Application',Case_Name__c='Completed Full App',Status='New',Origin='Web',Subject='This is test case by admin',Description='This is test desctiption by admin');
        Case studentcase=new Case(Account=account,Lead__c=lead.id,RecordTypeId = westSupportRecordTypeId ,ownerId = userInfo.getUserID(),Group__c='Student',Category__c='Academic',Activity__c='Grades',Case_Name__c='3 Fs',Status='New',Origin='Web',Subject='This is test case by student',Description='This is test desctiption by student');
         insert admincase;
         insert studentcase;
         ApexPages.currentPage().getParameters().put('id',admincase.id);
         CasesList caseslist=new CasesList();
         //ApexPages.currentPage().getParameters().put('id',account.id);
         List<Case> advisorcases=new List<Case>();
         List<Case> nonadvisorcases=new List<Case>();
         advisorcases=caseslist.getAdvisorCasesList();
         nonadvisorcases=caseslist.getNonAdvisorCasesList();
         for(Case advisorcase:advisorcases)
         {
            //System.assertEquals(advisorcase.CaseNumber, studentcase.CaseNumber);
            //System.assertEquals(advisorcase.Notes__c, studentcase.Notes__c);
            //System.assertEquals(advisorcase.Next_Call__c , studentcase.Next_Call__c );
            //System.assertEquals(advisorcase.Subject, admincase.Subject);
            //System.assertEquals(advisorcase.Description, admincase.Description);
            
         }  
        for(Case nonadvisorcase:nonadvisorcases)
        {
           //System.assertEquals(nonadvisorcase.CaseNumber, studentcase.CaseNumber);
            //System.assertEquals(nonadvisorcase.Notes__c, studentcase.Notes__c);
            //System.assertEquals(nonadvisorcase.Next_Call__c , studentcase.Next_Call__c );
            //System.assertEquals(nonadvisorcase.Subject, studentcase.Subject);
            //System.assertEquals(nonadvisorcase.Description, studentcase.Description);
            
         }
        
       
      }
    }